package com.tony.aop.interceptor;


import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class Test1Interceptor extends HandlerInterceptorAdapter {

     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        int a = 0;
        System.out.println("第一个拦截器preHandle");
        return true;
    }

    public void postHandleRender(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
        System.out.println();
        System.out.println("第一个拦截器的postHandle");
    }

    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
        System.out.println();
        System.out.println("第一个拦截器的afterCompletion");
    }
}
